
body {
    margin: 0;
    padding: 0;
    background-color: #121212;
    color: #EAECEF;
    font-family: 'Vazirmatn', sans-serif;
    direction: rtl;
    overflow-x: hidden;
}

#trend-line-svg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    opacity: 0.5;
}


#trend-line-svg use:first-of-type {
    fill: none;
    stroke: url(#line-gradient);
    stroke-width: 2px;
    filter: url(#glow-effect);
}


#trend-line-svg use:last-of-type {
    fill: none;
    stroke: #fac814;
    stroke-width: 3px;
    filter: url(#light-glow);


    stroke-dasharray: 25 1000;


    animation: moveLightLine 25s linear infinite;
}


@keyframes moveLightLine {
    0% {

        stroke-dashoffset: 100;
    }

    100% {

        stroke-dashoffset: -1000;
    }
}



#sticky-top-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;

    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

#live-ticker {
    background-color: #0A0A0A;
    color: #D4AF37;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 24px;
    font-size: 13px;
    font-weight: 500;
    gap: 24px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

#live-ticker>i {
    width: 1px;
    height: 14px;
    background-color: rgba(212, 175, 55, 0.3);
}

#live-ticker>:is(div,section[data-container])>strong {
    font-size: 15px;
    font-family: monospace;
    letter-spacing: 1px;
    transition: color 0.3s, text-shadow 0.3s;
}

#live-ticker>p {
    margin: 0 0 0 auto;
    color: #848E9C;
    font-size: 12px;
}

#live-ticker>p>span {
    color: #EAECEF;
    font-weight: bold;
}


strong[data-status="up"] {
    color: #0ECB81;
    text-shadow: 0 0 8px rgba(14, 203, 129, 0.5);
}

strong[data-status="down"] {
    color: #F6465D;
    text-shadow: 0 0 8px rgba(246, 70, 93, 0.5);
}


#site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 60px;
    background: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

#site-header>nav>ul {
    display: flex;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
    position: relative;
}

#site-header>nav>ul>li>a {
    color: #EAECEF;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s;
}

#site-header>nav>ul>li>a:hover {
    color: #D4AF37;
}

#site-header>:is(div,section[data-container]):nth-child(3) {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    direction: ltr;
    margin-left: 100px;
}


#site-header>:is(div,section[data-container]):nth-child(3)>img {
    height: 55px;
    width: auto;
}


#site-header>:is(div,section[data-container]):nth-child(3)>:is(div,section[data-container]) {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}


#site-header>:is(div,section[data-container]):nth-child(3)>:is(div,section[data-container])>h1 {
    color: #D4AF37;
    margin: 0;
    font-size: 26px;
    letter-spacing: 3px;
    font-family: serif;
}


#site-header>:is(div,section[data-container]):nth-child(3)>:is(div,section[data-container])>span {
    color: #848E9C;
    font-size: 12px;
    letter-spacing: 5px;
}

#site-header>:is(div,section[data-container]):last-child {
    display: flex;
    gap: 20px;
}

#site-header>:is(div,section[data-container]):last-child>button {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

#site-header>:is(div,section[data-container]):last-child>button>svg {
    width: 24px;
    height: 24px;
    fill: #EAECEF;
    transition: fill 0.3s, transform 0.3s;
}

#site-header>:is(div,section[data-container]):last-child>button:hover>svg {
    fill: #f9c518;
    transform: translateY(-2px);
}

/* =========================================================
   منوی کشویی حساب کاربری (کاملاً تو در تو و بدون کلاس)
========================================================= */

/* تنظیمات باکس نگه‌دارنده دکمه و منو */
#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* هماهنگ کردن دکمه حساب با بقیه دکمه‌های هدر */
#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper > button {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper > button > svg {
    width: 24px;
    height: 24px;
    fill: #EAECEF;
    transition: fill 0.3s, transform 0.3s;
}

#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper > button:hover > svg {
    fill: #f9c518;
    transform: translateY(-2px);
}

/* دایره وضعیت (قرمزِ پیش‌فرض) */
#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper > button > span#auth-status-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 6px;
    height: 6px;
    background-color: #dc3545;
    border-radius: 50%;
    border: 2px solid #121212;
    box-shadow: 0 0 5px #dc3545;
    z-index: 10;
    transition: all 0.3s ease;
}

/* کادر اصلی منوی کشویی */
#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper > :is(div,section[data-container])#user-dropdown {
    position: absolute;
    top: 150%; 
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8), 0 0 15px rgba(212, 175, 55, 0.05);
    min-width: 150px;
    display: flex;
    flex-direction: column;
    padding: 5px 0;
    z-index: 1000;
    
    /* مخفی بودن اولیه */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

/* پل نامرئی بین دکمه و منو */
#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper > :is(div,section[data-container])#user-dropdown::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 0;
    width: 100%;
    height: 30px;
    background: transparent;
}

/* 🔴 جادوی باز شدن منو: وقتی دکمه لاگین بود و موس روی آن رفت */
#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper[data-logged-in="true"]:hover > :is(div,section[data-container])#user-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

/* بخش نام کاربر (بالای کشو) */
#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper > :is(div,section[data-container])#user-dropdown > :is(div,section[data-container]):first-child {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    white-space: nowrap;
}

#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper > :is(div,section[data-container])#user-dropdown > :is(div,section[data-container]):first-child > span {
    color: #D4AF37;
    font-weight: bold;
    font-size: 13px;
}

/* لینک‌ها و دکمه‌های داخل منو */
#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper > :is(div,section[data-container])#user-dropdown > a, 
#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper > :is(div,section[data-container])#user-dropdown > button {
    background: transparent;
    border: none;
    color: #EAECEF;
    padding: 12px 15px;
    font-size: 13.5px;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper > :is(div,section[data-container])#user-dropdown > a:hover {
    background: rgba(212, 175, 55, 0.05);
    color: #D4AF37;
}

/* دکمه خروج */
#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper > :is(div,section[data-container])#user-dropdown > button#logout-btn {
    color: #F6465D;
    font-weight: 500;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper > :is(div,section[data-container])#user-dropdown > button#logout-btn:hover {
    background: rgba(246, 70, 93, 0.1);
}

#site-header > :is(div,section[data-container]):last-child > :is(div,section[data-container])#auth-wrapper[data-logged-in="true"] > button > span#auth-status-dot {
    background-color: #28a745 ;
    box-shadow: 0 0 5px #28a745 ;
    border-color: #121212 ;
}

#site-header>nav>ul>li {
    position: relative;
    padding-bottom: 25px;
    /* فضای مخفی تا وقتی موس پایین می‌رود منو بسته نشود */
    margin-bottom: -25px;
}

/* کادر شیشه‌ای اصلی مگامنو */
#site-header>nav>ul>li>:is(div,section[data-container])[data-role="mega-menu"] {
    position: absolute;
    top: 100%;
    right: 0;
    width: 480px;
    min-height: 260px;
    background: #0f0f0f;
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 0, 0, 0.5);

    opacity: 0;
    visibility: hidden;
    /* 👈 این خط مشکل رو کاملاً ریشه‌کن می‌کنه: منوی بسته، لمس نمیشه */
    pointer-events: none;
    transform: translateY(15px);

    /* زمان انیمیشن رو کمی سریع‌تر کردم تا پرش نداشته باشه */
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;

    display: flex;
    overflow: hidden;
    z-index: 1000;
}

#site-header>nav>ul>li>:is(div,section[data-container])[data-role="mega-menu"]::before {
    content: '';
    position: absolute;
    top: -30px;
    left: 0;
    width: 100%;
    height: 20px;
    background: transparent;
}

/* باز شدن کادر هنگام رفتن موس روی طلای زینتی */
#site-header>nav>ul>li:hover>:is(div,section[data-container])[data-role="mega-menu"] {
    opacity: 1;
    visibility: visible;
    /* 👈 وقتی منو باز شد، دوباره قابل لمس میشه */
    pointer-events: auto;
    transform: translateY(0);
}

/* ----------------------------------
   سمت راست: دسته‌بندی‌های اصلی
---------------------------------- */
:is(div,section[data-container])[data-role="mega-menu"]>ul[data-role="mega-nav"] {
    width: 150px;
    /* عرض ستون راست */
    list-style: none;
    margin: 0;
    padding: 15px 0;
    background: rgba(255, 255, 255, 0.02);
    border-left: 1px solid rgba(212, 175, 55, 0.1);
    /* خط جداکننده ظریف */
}

:is(div,section[data-container])[data-role="mega-menu"]>ul[data-role="mega-nav"]>li>a {
    display: block;
    padding: 12px 20px;
    color: #EAECEF;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s, color 0.3s;
    position: relative;
}

/* افکت هاور روی دسته‌های اصلی */
:is(div,section[data-container])[data-role="mega-menu"]>ul[data-role="mega-nav"]>li:hover>a {
    background: rgba(212, 175, 55, 0.1);
    color: #D4AF37;
    font-weight: 500;
}

/* ----------------------------------
   سمت چپ: محتوای زیرمجموعه‌ها
---------------------------------- */
:is(div,section[data-container])[data-role="mega-content"] {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 150px;
    /* شروع از لبه‌ی ستون راست */
    left: 0;
    padding: 25px 30px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

/* تیتر و لیست‌های سمت چپ */
:is(div,section[data-container])[data-role="mega-content"]>h3 {
    color: #D4AF37;
    font-size: 16px;
    margin: 0 0 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
}

:is(div,section[data-container])[data-role="mega-content"]>ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* دو ستونه شدن زیرمجموعه‌ها */
    gap: 15px;
}

:is(div,section[data-container])[data-role="mega-content"]>ul>li>a {
    color: #848E9C;
    text-decoration: none;
    font-size: 13.5px;
    transition: color 0.3s, transform 0.3s;
    display: inline-block;
}

:is(div,section[data-container])[data-role="mega-content"]>ul>li>a:hover {
    color: #FFF;
    transform: translateX(-4px);
    /* یک حرکت شیک به سمت چپ */
}



/* ----------------------------------
   جادوی تب‌منو با CSS (بخش طلایی کار)
---------------------------------- */
/* ۱. نمایش گزینه اول (انگشتر) به صورت پیش‌فرض تا کادر خالی نماند */
ul[data-role="mega-nav"]>li:first-child>:is(div,section[data-container])[data-role="mega-content"] {
    opacity: 1;
    visibility: visible;
}

/* ۲. وقتی کاربر موس را روی هر گزینه‌ی دیگری می‌برد، گزینه اول مخفی شود */
ul[data-role="mega-nav"]:hover>li:first-child>:is(div,section[data-container])[data-role="mega-content"] {
    opacity: 0;
    visibility: hidden;
}

/* ۳. مگر اینکه کاربر مستقیماً روی خود گزینه اول برود */
ul[data-role="mega-nav"]>li:first-child:hover>:is(div,section[data-container])[data-role="mega-content"] {
    opacity: 1;
    visibility: visible;
}

/* ۴. نمایش محتوای هر گزینه‌ای که کاربر موس را روی آن می‌برد */
ul[data-role="mega-nav"]>li:hover>:is(div,section[data-container])[data-role="mega-content"] {
    opacity: 1;
    visibility: visible;
}

#site-header>button[data-role="hamburger-btn"] {
    display: none;
    background: transparent;
    border: none;
    color: #EAECEF;
    cursor: pointer;
    padding: 5px;
    position: relative;
    /* اضافه شود */
    z-index: 2100;
}

#site-header>button[data-role="hamburger-btn"]>svg {
    width: 28px;
    height: 28px;
    stroke: #D4AF37;
    /* رنگ طلایی */
    transition: transform 0.3s ease;
}

#site-header>button[data-role="hamburger-btn"]:active>svg {
    transform: scale(0.9);
}

#site-header>button[data-role="hamburger-btn"],
#site-header>nav>button[data-role="close-menu"],
#site-header>nav>:is(div,section[data-container])[data-role="mobile-icons"] {
    display: none;
}

li[data-mobile-only="true"] {
    display: none;
}

/* =========================================================
   بخش طلای آب‌شده (Melted Gold Investment)
========================================================= */
#melted-gold-investment {
    padding: 80px 10%;
    position: relative;
    z-index: 2;
}

#melted-gold-investment > header {
    text-align: center;
    margin-bottom: 50px;
}

#melted-gold-investment > header > h2 {
    margin: 0 0 16px 0;
    color: #EAECEF;
    font-size: 28px;
    font-weight: 600;
}

#melted-gold-investment > header > h2 > span {
    color: #D4AF37;
}

#melted-gold-investment > header > p {
    color: #848E9C;
    font-size: 15px;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

/* کادر اصلی دربرگیرنده مزایا و ماشین‌حساب */
#melted-gold-investment > :is(div,section[data-container])[data-layout="investment-container"] {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
    align-items: center;
}

/* ----------------------------------
   کارت مزایا (سمت راست)
---------------------------------- */
#melted-gold-investment article[data-role="benefits"] > h3 {
    color: #EAECEF;
    font-size: 22px;
    margin: 0 0 25px 0;
}

#melted-gold-investment article[data-role="benefits"] > ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

#melted-gold-investment article[data-role="benefits"] > ul > li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

#melted-gold-investment article[data-role="benefits"] > ul > li > svg {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background: rgba(212, 175, 55, 0.1);
    padding: 8px;
    border-radius: 8px;
}

#melted-gold-investment article[data-role="benefits"] > ul > li > :is(div,section[data-container]) {
    display: flex;
    flex-direction: column;
}

#melted-gold-investment article[data-role="benefits"] > ul > li > :is(div,section[data-container]) > strong {
    color: #EAECEF;
    font-size: 16px;
    margin-bottom: 5px;
}

#melted-gold-investment article[data-role="benefits"] > ul > li > :is(div,section[data-container]) > span {
    color: #848E9C;
    font-size: 13.5px;
    line-height: 1.6;
}

/* ----------------------------------
   کارت ماشین‌حساب (سمت چپ)
---------------------------------- */
#melted-gold-investment article[data-role="melted-calculator"] {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 16px;
    padding: 35px;
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

#melted-gold-investment article[data-role="melted-calculator"] > h3 {
    color: #D4AF37;
    margin: 0 0 10px 0;
    font-size: 20px;
}

#melted-gold-investment article[data-role="melted-calculator"] > p {
    color: #848E9C;
    font-size: 13px;
    margin: 0 0 30px 0;
    line-height: 1.6;
}

#melted-calc-form > fieldset {
    border: none;
    padding: 0;
    margin: 0 0 25px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

#melted-calc-form > fieldset > :is(div,section[data-container]) {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#melted-calc-form > fieldset > :is(div,section[data-container]) > label {
    color: #EAECEF;
    font-size: 13px;
    margin-bottom: 8px;
}

/* استایل ورودی‌ها (Inputs) */
#melted-calc-form input[type="number"] {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 14px;
    color: #D4AF37;
    font-family: monospace;
    font-size: 18px;
    font-weight: bold;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    text-align: left; /* اعداد چپ‌چین باشند بهتر است */
    direction: ltr;
}

#melted-calc-form input[type="number"]:focus {
    border-color: #D4AF37;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

/* آیکون تبدیل وسط فرم */
i[data-role="exchange-icon"] {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 25px; /* هم‌ترازی با اینپوت‌ها */
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

i[data-role="exchange-icon"] > svg {
    width: 20px;
    height: 20px;
}

/* دکمه ثبت سفارش */
#melted-order-btn {
    width: 100%;
    background: linear-gradient(135deg, #F0B90B, #D4AF37);
    color: #121212;
    border: none;
    border-radius: 8px;
    padding: 16px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

#melted-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.3);
}

/* ----------------------------------
   رسپانسیو (تبلت و موبایل)
---------------------------------- */
@media (max-width: 1032px) {
      #site-header {
        position: relative;
        padding: 15px 5%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    /* ۲. نمایش دکمه همبرگر (نفر اول در هدر، بنابراین سمت راست می‌افتد) */
    #site-header > button[data-role="hamburger-btn"] {
        display: block; 
    }

    #site-header:has(nav[data-open="true"]) > button[data-role="hamburger-btn"] {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: scale(0.8); /* یک افکت نرمِ جمع شدن */
        transition: all 0.3s ease;
    }
    
    /* اضافه کردن ترنزیشن به حالت عادی دکمه برای برگشتِ نرم */
    #site-header > button[data-role="hamburger-btn"] {
        transition: all 0.3s ease;
    }

    /* ۳. وسط‌چین کردن لوگو (نفر سوم هدر) */
    #site-header>:is(div,section[data-container]):nth-of-type(1) {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin-left: 0;
    }

    #site-header>:is(div,section[data-container]):nth-of-type(1)>img {
        height: 40px;
    }

    #site-header>:is(div,section[data-container]):nth-of-type(1)>:is(div,section[data-container])>h1 {
        font-size: 18px;
        letter-spacing: 2px;
    }

    #site-header>:is(div,section[data-container]):nth-of-type(1)>:is(div,section[data-container])>span {
        font-size: 10px;
        letter-spacing: 3px;
    }

    /* ۴. مخفی کردن کامل آیکون‌های دسکتاپ (نفر آخر هدر) */
    #site-header>:is(div,section[data-container]):last-child {
        display: none;
    }

    /* ۵. تبدیل Nav به کشوی سمت راست */
    #site-header>nav {
        position: fixed;
        top: 0;
        right: -320px;
        /* مخفی شده در بیرون صفحه */
        width: 280px;
        height: 100vh;
        background: rgba(15, 15, 15,0.92);
        backdrop-filter: blur(20px);
        border-left: 1px solid rgba(212, 175, 55, 0.15);
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
        z-index: 2000;
        display: flex;
        flex-direction: column;
        padding: 80px 20px 20px 20px;
        /* فاصله از بالا برای دکمه بستن */
        transition: right 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        overflow-y: auto;
    }


    /* وقتی منو باز است */
    #site-header>nav[data-open="true"] {
        right: 0;
    }

    /* دکمه ضربدر برای بستن منو */
    #site-header>nav>button[data-role="close-menu"] {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 20px;
        right: 20px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: #EAECEF;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        font-size: 16px;
        cursor: pointer;
        transition: background 0.3s, color 0.3s;
    }

    #site-header>nav>button[data-role="close-menu"]:hover {
        background: #F6465D;
        color: #FFF;
    }

    /* لیست‌های منو به صورت عمودی */
    #site-header>nav>ul {
        flex-direction: column;
        gap: 0;
    }

    #site-header>nav>ul>li {
        padding: 0;
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    #site-header>nav>ul>li>a {
        display: block;
        padding: 18px 10px;
        font-size: 16px;
    }

    /* رفتار مگامنو در موبایل (آکاردئونی) */
    #site-header>nav>ul>li>:is(div,section[data-container])[data-role="mega-menu"] {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        min-height: auto;
        transform: none ;
        box-shadow: none;
        border: none;
        border-radius: 0;
        background: transparent;
        display: none;
        padding: 0;
        margin-bottom: 15px;
    }

    #site-header>nav>ul>li:hover>:is(div,section[data-container])[data-role="mega-menu"] {
        display: flex;
        flex-direction: column;
    }

    :is(div,section[data-container])[data-role="mega-menu"]>ul[data-role="mega-nav"] {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        padding: 10px;
        background: transparent;
        border: none;
    }

    :is(div,section[data-container])[data-role="mega-menu"]>ul[data-role="mega-nav"]>li>a {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 6px;
        padding: 8px 15px;
        font-size: 13px;
    }

#site-header > :is(div,section[data-container]):last-child {
        display: flex;
        gap: 12px; /* فاصله کمتر در موبایل */
    }
    
    /* مخفی کردن آیکون تماس با ما (چون به داخل منو منتقل شد) */
    #site-header > :is(div,section[data-container]):last-child > button[data-role="contact-btn"] {
        display: none;
    }

    /* کمی کوچک‌تر کردن آیکون‌ها برای جا شدن در کنار لوگو */
    #site-header > :is(div,section[data-container]):last-child > button > svg {
        width: 22px;
        height: 22px;
    }

    /* نمایش مجدد گزینه "تماس با ما" در کشوی منوی موبایل */
    li[data-mobile-only="true"] {
        display: block;
        margin-top: 15px; /* کمی فاصله از بقیه منوها */
        border-top: 1px dashed rgba(212, 175, 55, 0.2); /* یه خط جداکننده شیک */
        padding-top: 15px;
    }
    li[data-mobile-only="true"] > a {
        color: #D4AF37 !important; /* رنگ طلایی برای تاکید بیشتر */
    }
    /* نمایش آیکون‌های موبایل در انتهای منو */
    #site-header>nav>:is(div,section[data-container])[data-role="mobile-icons"] {
        display: flex;
        justify-content: space-around;
        margin-top: auto;
        /* هول دادن به پایین کادر */
        padding-top: 25px;
        border-top: 1px dashed rgba(212, 175, 55, 0.2);
    }

    #site-header>nav>:is(div,section[data-container])[data-role="mobile-icons"]>button {
        background: transparent;
        border: none;
        color: #EAECEF;
        padding: 10px;
    }

    :is(div,section[data-container])[data-role="mega-content"] {
        display: none ;
    }

    #site-header>nav>:is(div,section[data-container])[data-role="mobile-icons"]>button>svg {
        width: 24px;
        height: 24px;
        stroke: currentColor;
        fill: none;
    }


    #melted-gold-investment > :is(div,section[data-container])[data-layout="investment-container"] {
        grid-template-columns: 1fr; /* زیر هم قرار گرفتن مزایا و فرم */
        gap: 50px;
    }
}

@media (max-width: 768px) {
      #live-ticker {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px 20px;
        padding: 12px 5%;
        overflow: hidden;
    }

    #live-ticker>i {
        display: none;
    }

    #live-ticker>p {
        width: 100%;
        text-align: center;
        margin: 5px 0 0 0;
        padding-top: 10px;
        border-top: 1px dashed rgba(212, 175, 55, 0.2);
    }

    #melted-calc-form > fieldset {
        flex-direction: column; /* اینپوت‌ها در موبایل زیر هم می‌روند */
        gap: 15px;
    }
    i[data-role="exchange-icon"] {
        margin-top: 0;
        transform: rotate(90deg); /* چرخش آیکون تبدیل به حالت عمودی */
    }
}

/* تنظیمات پایه صفحه؛ همه استایل‌ها خارج از HTML هستند. */
#melted-page {
    --gold: #D4AF37;
    --muted: #b6bac3;
    --line: #34363c;

    width: min(1160px, calc(100% - 40px));
    margin: 0 auto;
    padding: 52px 0 64px;
    color: #f2f3f5;
    font-size: 16px;
    line-height: 1.9;
    direction: rtl;
}

#melted-page,
#melted-page * {
    box-sizing: border-box;
}

#melted-page [hidden] {
    display: none;
}

#melted-page h1,
#melted-page h2,
#melted-page p {
    margin: 0;
}

#melted-page h2 {
    font-size: 21px;
    line-height: 1.6;
}

#melted-page p {
    color: var(--muted);
}

#melted-page button,
#melted-page input {
    font: inherit;
}

#melted-page button,
#melted-page summary {
    cursor: pointer;
}

/* مشخص‌بودن محل فوکوس برای کار با کیبورد. */
#melted-page :is(button, input, a, summary):focus-visible,
#melted-summary:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 4px;
}

#melted-page [data-role="eyebrow"] {
    color: var(--gold);
    font-size: 13px;
    margin-bottom: 10px;
}

#melted-page [data-role="footnote"] {
    font-size: 13px;
    line-height: 1.9;
}

/* معرفی بالای صفحه */
#melted-intro {
    max-width: 780px;
    margin-bottom: 28px;
}

#melted-intro h1 {
    font-size: clamp(29px, 4vw, 46px);
    line-height: 1.5;
    margin-bottom: 12px;
}

#melted-intro h1 span {
    color: var(--gold);
}

/* سه توضیح کوتاه درباره طلای آب‌شده */
#melted-guide {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

/* Same translucent surface as the homepage investment calculator. */
#melted-guide article,
#melted-estimate-form,
#melted-summary {
    background: rgba(255, 255, 255, 0.03);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

#melted-guide article {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
}

#melted-guide article > span {
    color: var(--gold);
    font-size: 13px;
}

#melted-guide h2 {
    font-size: 18px;
    margin: 8px 0;
}

#melted-guide p {
    font-size: 14px;
}

/* minmax اجازه نمی‌دهد محتوا ستون‌ها را از عرض صفحه بیرون ببرد. */
#melted-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

#melted-estimate-form,
#melted-summary {
    min-width: 0;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 22px;
}

#melted-estimate-form > header {
    margin-bottom: 24px;
}

#melted-estimate-form > header > p:last-child {
    margin-top: 8px;
    font-size: 14px;
}

/* انتخاب روش محاسبه */
#melted-mode {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-width: 0;
    padding: 0;
    border: 0;
    margin: 0 0 24px;
}

#melted-mode legend {
    padding: 0;
    margin-bottom: 10px;
    font-size: 14px;
}

#melted-mode label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 160px;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    cursor: pointer;
}

#melted-mode input {
    accent-color: var(--gold);
    width: 17px;
    height: 17px;
    margin: 0;
}

#melted-mode label:has(input:checked) {
    border-color: var(--gold);
    background: #29271f;
}

/* ورودی مبلغ یا وزن */
#melted-input-label {
    display: block;
    margin-bottom: 10px;
    font-size: 15px;
}

#melted-input-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border: 1px solid #50525b;
    background: #121418;
    border-radius: 12px;
}

#melted-input-box:focus-within {
    border-color: var(--gold);
}

#melted-page #melted-value:focus,
#melted-page #melted-value:focus-visible {
    outline: none;
    box-shadow: none;
}

#melted-value {
    width: 100%;
    min-width: 0;
    height: 62px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 23px;
    direction: ltr;
    text-align: right;
}

#melted-value::placeholder {
    font-size: 16px;
    color: #9096a3;
}

#melted-unit {
    flex-shrink: 0;
    color: var(--gold);
    font-size: 14px;
}

#melted-hint {
    font-size: 12px;
    margin-top: 8px;
}

#melted-page #melted-error {
    color: #ffb4b4;
    font-size: 13px;
    margin-top: 8px;
}

#melted-value[aria-invalid="true"] {
    color: #ffb4b4;
}

/* انتخاب سریع مقادیر */
#melted-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0 24px;
}

#melted-presets button {
    flex: 1 1 90px;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #20232a;
    color: #e5e7eb;
    font-size: 14px;
}

#melted-submit {
    width: 100%;
    min-height: 50px;
    padding: 12px 18px;
    border: 0;
    border-radius: 12px;
    background: var(--gold);
    color: #191710;
    font-weight: 700;
}

#melted-submit:disabled {
    opacity: .45;
    cursor: not-allowed;
}

#melted-estimate-form > [data-role="footnote"] {
    margin-top: 12px;
    text-align: center;
}

/* خلاصه: ارزش پایه و هزینه‌های محاسبه‌نشده جدا نمایش داده می‌شوند. */
#melted-summary {
    border-top: 3px solid var(--gold);
}

#melted-page [data-role="badge"] {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 8px;
    color: #e6d6ad;
    background: #302b20;
    font-size: 12px;
    margin-bottom: 18px;
}

#melted-summary h2 {
    margin-bottom: 16px;
}

#melted-summary > p {
    font-size: 14px;
}

#melted-rate {
    display: block;
    margin: 8px 0;
    color: var(--gold);
    font-size: clamp(22px, 3vw, 30px);
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

#melted-page #melted-rate-note {
    font-size: 12px;
}

#melted-summary dl {
    margin: 24px 0;
}

#melted-summary dl > :is(div,section[data-container]) {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

#melted-summary dt {
    color: var(--muted);
    font-size: 14px;
}

#melted-summary dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

#melted-page #melted-result-note {
    margin-bottom: 14px;
    color: #eee1c0;
}

#melted-summary > a {
    display: inline-block;
    color: var(--gold);
    margin-top: 20px;
    text-underline-offset: 5px;
}

/* راهنمای خرید */
#melted-steps,
#melted-faq {
    margin-top: 44px;
}

#melted-steps ol {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    padding: 0 24px 0 0;
    margin: 22px 0 0;
}

#melted-steps li {
    padding-inline-start: 5px;
}

#melted-steps li::marker {
    color: var(--gold);
    font-weight: 700;
}

#melted-steps p {
    font-size: 14px;
    margin-top: 6px;
}

/* پرسش‌های متداول؛ باز و بسته‌شدن با HTML انجام می‌شود. */
#melted-faq {
    scroll-margin-top: 100px;
}

#melted-faq h2 {
    margin-bottom: 18px;
}

#melted-faq details {
    border-bottom: 1px solid var(--line);
    padding: 4px 0;
}

#melted-faq summary {
    padding: 16px 4px;
    font-weight: 500;
}

#melted-faq details[open] summary {
    color: var(--gold);
}

#melted-faq details p {
    padding: 0 4px 18px;
    font-size: 14px;
}

/* افکت‌های ساده فقط برای دستگاه‌های دارای hover */
@media (hover: hover) {
    #melted-presets button:hover {
        border-color: var(--gold);
    }

    #melted-submit:not(:disabled):hover {
        background: #edd296;
    }
}

@media (prefers-reduced-motion: no-preference) {
    #melted-page button {
        transition: background-color .18s ease, border-color .18s ease;
    }
}

/* هدر موجود: جلوگیری از هم‌پوشانی لوگو و آیکون‌ها */
@media (max-width: 1032px) {
    #site-header {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 8px;
        align-items: center;
    }

    #site-header > :is(div,section[data-container]):nth-of-type(1) {
        position: static;
        transform: none;
        margin: 0;
        min-width: 0;
        justify-self: center;
        gap: 8px;
    }

    #site-header > :is(div,section[data-container]):last-child {
        gap: 10px;
    }

    #site-header > :is(div,section[data-container]):last-child > button[data-role="quick-calc"] {
        display: none;
    }

    #site-header > nav {
        box-sizing: border-box;
        width: min(300px, 90vw);
        height: 100dvh;
    }

    #melted-guide {
        gap: 12px;
    }

    #melted-guide article {
        padding: 18px;
    }
}

/* تبلت باریک: فرم و خلاصه زیر هم قرار می‌گیرند. */
@media (max-width: 820px) {
    #melted-workspace {
        grid-template-columns: minmax(0, 1fr);
    }

    #melted-estimate-form,
    #melted-summary {
        padding: 24px;
    }
}

/* موبایل */
@media (max-width: 640px) {
    #melted-page {
        width: calc(100% - 32px);
        padding-top: 28px;
    }

    #melted-guide,
    #melted-steps ol {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    #melted-guide article {
        padding: 18px;
    }

    #melted-estimate-form,
    #melted-summary {
        padding: 20px;
        border-radius: 16px;
    }

    #melted-mode label {
        flex-basis: 120px;
        font-size: 14px;
    }

    #site-header > :is(div,section[data-container]):nth-of-type(1) > img {
        height: 30px;
    }

    #site-header > :is(div,section[data-container]):nth-of-type(1) > :is(div,section[data-container]) > h1 {
        font-size: 14px;
        letter-spacing: 1px;
    }

    #site-header > :is(div,section[data-container]):nth-of-type(1) > :is(div,section[data-container]) > span {
        font-size: 9px;
        letter-spacing: 1px;
    }

    #site-header > :is(div,section[data-container]):last-child > button {
        min-width: 32px;
        min-height: 44px;
    }
}